package com.atguigu.gmall.feign.product;

import com.atguigu.gmall.feign.product.impl.SkuInfoFeignClientFallback;
import com.atguigu.gmall.model.product.BaseCategoryView;
import com.atguigu.gmall.model.product.SkuInfo;
import com.atguigu.gmall.model.product.SpuSaleAttr;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@RequestMapping("/api/product")
@FeignClient(value = "service-product",fallback = SkuInfoFeignClientFallback.class)
public interface SkuInfoFeignClient {

    //Consider defining a bean of type
    // 'com.atguigu.gmall.product.SpuFeignClient' in your configuration.

    @GetMapping("/inner/getSkuInfo/{skuId}")
    SkuInfo getSkuInfo(@PathVariable("skuId") Long skuId);

    @GetMapping("/inner/getCategoryView/{category3Id}")
    BaseCategoryView getSkuCategorys(@PathVariable("category3Id") Long category3Id);


    @GetMapping("/inner/getSkuPrice/{skuId}")
    BigDecimal getSkuPrice(@PathVariable("skuId") Long skuId);

    @GetMapping("/inner/getSpuSaleAttrListCheckBySku/{skuId}/{spuId}")
    List<SpuSaleAttr> getSpuSaleAttrListCheckBySku(@PathVariable("skuId") Long skuId,
                                                   @PathVariable("spuId") Long spuId);

    @GetMapping("/inner/getSkuValueIdsMap/{spuId}")
    Map getSkuValueIdsMap(@PathVariable("spuId") Long spuId);

}
